package com.hangzhou.xyj.net.request;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.hangzhou.xyj.net.request.base.BaseRequest;
import com.hangzhou.xyj.utils.constants.API;

/**
 * Created by yaohuix on 2016/3/9  17:07
 * <p/>
 * 说明：获取名家、名团、用户等详情 请求
 */
public class GetUserDetailReq extends BaseRequest {
    JsonObject jsonObj = new JsonObject();

    /**
     * @param targetUserId 要获取的用户的Id
     * @return
     * @author yaohuix
     * @date 2016/3/9 17:08
     */
    public GetUserDetailReq(int targetUserId) {
        jsonObj.addProperty("targetUserId", targetUserId);
        String jsonStr = new Gson().toJson(jsonObj);
        add("data", jsonStr);
    }

    /**
     * @param targetUserId 要获取的用户的Id
     * @param fromUserId   谁在获取
     * @return
     * @author yaohuix
     * @date 2016/3/9 17:09
     */
    public GetUserDetailReq(int targetUserId, int fromUserId) {
        jsonObj.addProperty("targetUserId", targetUserId);
        jsonObj.addProperty("fromUserId", fromUserId);
        String jsonStr = new Gson().toJson(jsonObj);
        add("data", jsonStr);
    }

    @Override
    public String getUrl() {
        return API.USER_DETAIL;
    }
}
